from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
import time

testCase = "DBshop018-商品管理删除属性组流程"
# 1.登录后台，商品管理，商品属性，属性分组
firefox=openBrowser(url)
firefox.get(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性分组')
# 2.删除名称为 好好学习 的属性组
firefox.find_element_by_xpath("//td[contains(.,'好好学习')]/following-sibling::td[2]/a[2]").click()
time.sleep(5)
firefox.switch_to.alert.accept()
time.sleep(5)
# 断言：找不到 名称为 好好学习 的属性组即测试成功
# try:
#     firefox.find_element_by_xpath("//td[contains(.,'好好学习')]")
#     writeLog("%s 测试失败"%testCase)
#     getPhoto(firefox)
# except:
#     writeLog("%s 测试通过" % testCase)
# firefox.quit()

